/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controldepuntos.clases;

import java.awt.List;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Víctor
 */
@Entity
@Table(name = "tc_perfil")
@NamedQueries({
    @NamedQuery(name = "TcPerfil.findAll", query = "SELECT t FROM TcPerfil t")})
public class TcPerfil implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_perfil")
    private Integer idPerfil;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPerfil")
    private Collection<TrUsuario> trUsuarioCollection;

    public TcPerfil() {
    }

    public TcPerfil(Integer idPerfil) {
        this.idPerfil = idPerfil;
    }

    public Integer getIdPerfil() {
        return idPerfil;
    }

    public void setIdPerfil(Integer idPerfil) {
        this.idPerfil = idPerfil;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Collection<TrUsuario> getTrUsuarioCollection() {
        
        return trUsuarioCollection;
    }

    public void setTrUsuarioCollection(Collection<TrUsuario> trUsuarioCollection) {
        this.trUsuarioCollection = trUsuarioCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPerfil != null ? idPerfil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TcPerfil)) {
            return false;
        }
        TcPerfil other = (TcPerfil) object;
        if ((this.idPerfil == null && other.idPerfil != null) || (this.idPerfil != null && !this.idPerfil.equals(other.idPerfil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "controldepuntos.clases.TcPerfil[ idPerfil=" + idPerfil + " ]";
    }
    
}
